<?php

namespace app\user\controller;

use app\common\model\SystemAdmin;

class Login
{
	public function index ()
	{
		$data = array(
			'token' => "111111111111",
			"userinfo" => array(
				"id" => "2",
				"username" => "username",
				"dashboard" => "1",
				"role" => ["AAAAA"],
			),
		);
		$res['code'] = 200;
		$res['data'] = $data;
		$res['message'] = "";
		return json($res);
	}

	/* web login auth */
	public function auth ()
	{
		// dump(getRandom(6));
		// c1fb69
		// dump(password_hash("mengxuan", PASSWORD_DEFAULT));
		// dump(password_verify("mengxuan", "$2y$10$AuhDDGt0CiYPCn3XAZjV5.1XtGRoGjtm6gR82w/YPyICAPCmeyPGm"));
		return SystemAdmin::login();
	}

}








/*
{
	"code": 200,
	"data": {
		"token": "SCUI.user.Auth",
		"userInfo": {
			"userId": "2",
			"userName": "Lolowan",
			"dashboard": "1",
			"role": [
				"Auditor"
			]
		}
	},
	"message": ""
}




*/